package com.lihao.sam.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lihao.sam.dao.HealthStatisticsDao;
import com.lihao.sam.entity.HealthStatistics;
import com.lihao.sam.entity.ScoreEntry;
import com.lihao.sam.service.intf.HealthStatisticsService;
import com.lihao.sam.vo.PageVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 赵申奥
 * @Description:
 */
@Service
public class HealthStatisticsServiceImpl implements HealthStatisticsService {
    @Resource
    private HealthStatisticsDao dao;
    @Override
    public PageVo queryPage(String address, String buildNo, String floorNo, int page, int limit) {
        PageHelper.startPage(page, limit);
        PageInfo<HealthStatistics> pageInfo=new PageInfo<>(dao.selectAll(address, buildNo, floorNo));
        return PageVo.ok(pageInfo.getTotal(),pageInfo.getList());
    }
}
